WebSocketLog
WebSocketLog
The WebSocketLog component is a React component that displays a log of messages received from a WebSocket server. It uses the useSelector hook from react-redux to access the messages from the Redux store.
Usage
import WebSocketLog from './WebSocketLog';
const MyComponent = () => {
return (
<div>
<WebSocketLog />
{/* Other content */}
</div>
);
};
Props
This component does not accept any props.
Styling
The component uses inline styles to set the font size of the message list. This style can be modified to customize the appearance of the log.
Notes
- This component requires the
websocketreducer to be set up in the Redux store. - The
websocketreducer should contain an array ofWebsocketMessageobjects, each with acreatedDate,type,user, andpayloadproperty.